package com.tuo51.evaluate.domain.childrens;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.util.Date;

/**
 * *******************************
 * Created by Ron.
 * form com.tuo51
 * on 2017/7/13
 * *******************************
 */
@Entity
@Data
@Table(name = "children_extend_info")
@NoArgsConstructor
public class ChildrenExtendInfo {

    @Id
    @Column(columnDefinition = "varchar(32) COMMENT 'id' ")
    private String id;

    @Column(columnDefinition = "varchar(50) COMMENT '宝宝名称 （冗余）' ")
    private String childrenName;

    @Column(columnDefinition = "varchar(32) COMMENT '宝宝id' ", unique = true)
    private String childrenId;

    @JsonIgnore
    @OneToOne
    @JoinColumn(name = "childrenId", insertable = false, updatable = false)
    Children children;

    @Column(columnDefinition = " datetime COMMENT '通知测评日期'")
    private Date notifyEvaluateDate;

    @Column(columnDefinition = " varchar(32) default ''  COMMENT '监护人电话'")
    private String guardianPhone;

    @Column(columnDefinition = " varchar(32) default ''  COMMENT '监护人姓名'")
    private String guardianName;

    @Column(columnDefinition = " varchar(32) default ''  COMMENT '监护人关系'")
    private String guardianRelation;

    @Column(columnDefinition = " varchar(32) default ''  COMMENT '户籍类型'")
    private String householdType;

    @Column(columnDefinition = " varchar(32) default ''  COMMENT '身份证/出生证字段'")
    private String identityCard;

    @Column(columnDefinition = " varchar(500) default ''  COMMENT '擅长语言'")
    private String goodLanguageDesc;

    @Column(columnDefinition = " varchar(256) default ''  COMMENT '地址'")
    private String address;

    public static ChildrenExtendInfo of(String childrenId, String childrenName){
        ChildrenExtendInfo info = new ChildrenExtendInfo();
        info.setId(childrenId);
        info.setChildrenId(childrenId);
        info.setChildrenName(childrenName);
        return info;
    }
}
